/*
 * Copyright (c) 2023 iQi.Co.Ltd. All rights reserved.
 */
 
using System.Collections.Generic;
using NetProtocol.POD;
using NetProtocol.Enum;
using IQIGame.Onigao.Game;
using IQIGame.Onigao.GamePlay;
using IQIGame.Onigao.Framework;
using System.Threading.Tasks;
using System;

namespace NetProtocol.Server {
	/// <summary>
	/// 玩家业务模块
	/// module : player
	/// </summary>
	public interface SNetPlayer : INetServerModule {
		Dictionary<int, MessageHandler> INetServerModule.GetModuleFunction()
        {	
            return new()
            {
                { NetMessageId.player_changeName, (session, data) =>
		            {
#if ENABLE_NET_LOG || UNITY_EDITOR
						NetProtocolHelper.ServerLog(NetMessageId.player_changeName, "Recv->" + data.ToString());
#endif
		                ChangeNameRequest _data = (ChangeNameRequest)data;
						return CS_changeName(session, _data.newName);
		            } 
            	},
                { NetMessageId.player_changeData, (session, data) =>
		            {
#if ENABLE_NET_LOG || UNITY_EDITOR
						NetProtocolHelper.ServerLog(NetMessageId.player_changeData, "Recv->" + data.ToString());
#endif
		                ChangeDataRequest _data = (ChangeDataRequest)data;
						return CS_changeData(session, _data.type, _data.content);
		            } 
            	},
                { NetMessageId.player_getPlayerInfo, (session, data) =>
		            {
#if ENABLE_NET_LOG || UNITY_EDITOR
						NetProtocolHelper.ServerLog(NetMessageId.player_getPlayerInfo, "Recv->" + data.ToString());
#endif
		                GetPlayerInfoRequest _data = (GetPlayerInfoRequest)data;
						return CS_getPlayerInfo(session, _data.targetServerId, _data.targetPid);
		            } 
            	},
                { NetMessageId.player_useGiftCode, (session, data) =>
		            {
#if ENABLE_NET_LOG || UNITY_EDITOR
						NetProtocolHelper.ServerLog(NetMessageId.player_useGiftCode, "Recv->" + data.ToString());
#endif
		                UseGiftCodeRequest _data = (UseGiftCodeRequest)data;
						return CS_useGiftCode(session, _data.code);
		            } 
            	},
                { NetMessageId.player_changeKanban, (session, data) =>
		            {
#if ENABLE_NET_LOG || UNITY_EDITOR
						NetProtocolHelper.ServerLog(NetMessageId.player_changeKanban, "Recv->" + data.ToString());
#endif
		                ChangeKanbanRequest _data = (ChangeKanbanRequest)data;
						return CS_changeKanban(session, _data.cid);
		            } 
            	},
                { NetMessageId.player_triggerGuide, (session, data) =>
		            {
#if ENABLE_NET_LOG || UNITY_EDITOR
						NetProtocolHelper.ServerLog(NetMessageId.player_triggerGuide, "Recv->" + data.ToString());
#endif
		                TriggerGuideRequest _data = (TriggerGuideRequest)data;
						return CS_triggerGuide(session, _data.id, _data.step, _data.type);
		            } 
            	},
                { NetMessageId.player_refreshReadPoint, (session, data) =>
		            {
#if ENABLE_NET_LOG || UNITY_EDITOR
						NetProtocolHelper.ServerLog(NetMessageId.player_refreshReadPoint, "Recv->" + data.ToString());
#endif
		                RefreshReadPointRequest _data = (RefreshReadPointRequest)data;
						return CS_refreshReadPoint(session, _data.type);
		            } 
            	},
                { NetMessageId.player_saveSettingData, (session, data) =>
		            {
#if ENABLE_NET_LOG || UNITY_EDITOR
						NetProtocolHelper.ServerLog(NetMessageId.player_saveSettingData, "Recv->" + data.ToString());
#endif
		                SaveSettingDataRequest _data = (SaveSettingDataRequest)data;
						return CS_saveSettingData(session, _data.key, _data.value);
		            } 
            	},
                { NetMessageId.player_uploadStoryCompleted, (session, data) =>
		            {
#if ENABLE_NET_LOG || UNITY_EDITOR
						NetProtocolHelper.ServerLog(NetMessageId.player_uploadStoryCompleted, "Recv->" + data.ToString());
#endif
		                UploadStoryCompletedRequest _data = (UploadStoryCompletedRequest)data;
		                CS_uploadStoryCompleted(session, _data.areaType, _data.storyCid);
		                return VoidMessageResult.Instance;
		            } 
            	},
            };
        }
        
        Dictionary<int, Func<IReceiveMessage>> INetServerModule.GetModuleRequest() 
        {
	        return new ()
	        {
	        	{NetMessageId.player_changeName, ()=> new ChangeNameRequest()},
	        	{NetMessageId.player_changeData, ()=> new ChangeDataRequest()},
	        	{NetMessageId.player_getPlayerInfo, ()=> new GetPlayerInfoRequest()},
	        	{NetMessageId.player_useGiftCode, ()=> new UseGiftCodeRequest()},
	        	{NetMessageId.player_changeKanban, ()=> new ChangeKanbanRequest()},
	        	{NetMessageId.player_triggerGuide, ()=> new TriggerGuideRequest()},
	        	{NetMessageId.player_refreshReadPoint, ()=> new RefreshReadPointRequest()},
	        	{NetMessageId.player_saveSettingData, ()=> new SaveSettingDataRequest()},
	        	{NetMessageId.player_uploadStoryCompleted, ()=> new UploadStoryCompletedRequest()},
	        };
	    }
        
#region Server-side Interface
		/// <summary>
        ///  修改玩家名称
        /// </summary>
	    protected ChangeNameResult CS_changeName(ISession session, string newName);
		/// <summary>
        ///  修改个人资料
        /// </summary>
	    protected ChangeDataResult CS_changeData(ISession session, ChangeDataType type, string content);
		/// <summary>
        ///  得到玩家信息
        /// </summary>
	    protected GetPlayerInfoResult CS_getPlayerInfo(ISession session, string targetServerId, long targetPid);
		/// <summary>
        ///  兑换码
        /// </summary>
	    protected UseGiftCodeResult CS_useGiftCode(ISession session, string code);
		/// <summary>
        ///  改变看板娘
        /// </summary>
	    protected ChangeKanbanResult CS_changeKanban(ISession session, int cid);
		/// <summary>
        ///  触发引导
        /// </summary>
	    protected TriggerGuideResult CS_triggerGuide(ISession session, int id, int step, TriggerGuideType type);
		/// <summary>
        /// 
        /// </summary>
	    protected RefreshReadPointResult CS_refreshReadPoint(ISession session, int type);
		/// <summary>
        ///  保存设置数据
        /// </summary>
	    protected SaveSettingDataResult CS_saveSettingData(ISession session, string key, string value);
		/// <summary>
        /// 上报剧情完成
        /// </summary>
    	protected bool CS_uploadStoryCompleted(ISession session, GamePlayAreaType areaType, int storyCid);
#endregion
#region Client-side Interface
		/// <summary>
        /// 
        /// </summary>
        public ChangeNameResult SC_changeNameResult(Task<ChangeNameResult> future){return new ChangeNameResult(future);}
        public ChangeNameResult SC_changeNameResult(int code){return new ChangeNameResult(code);}
		/// <summary>
        /// 
        /// </summary>
        public ChangeDataResult SC_changeDataResult(Task<ChangeDataResult> future){return new ChangeDataResult(future);}
        public ChangeDataResult SC_changeDataResult(int code, ChangeDataType type){return new ChangeDataResult(code, type);}
        public ChangeDataResult SC_changeDataResult(int code){return new ChangeDataResult(code);}
		/// <summary>
        /// 
        /// </summary>
        public GetPlayerInfoResult SC_getPlayerInfoResult(Task<GetPlayerInfoResult> future){return new GetPlayerInfoResult(future);}
        public GetPlayerInfoResult SC_getPlayerInfoResult(int code, PlayerShowPOD playerShow){return new GetPlayerInfoResult(code, playerShow);}
        public GetPlayerInfoResult SC_getPlayerInfoResult(int code){return new GetPlayerInfoResult(code);}
		/// <summary>
        /// 
        /// </summary>
        public UseGiftCodeResult SC_useGiftCodeResult(Task<UseGiftCodeResult> future){return new UseGiftCodeResult(future);}
        public UseGiftCodeResult SC_useGiftCodeResult(int code, List<ItemShowPOD> items){return new UseGiftCodeResult(code, items);}
        public UseGiftCodeResult SC_useGiftCodeResult(int code){return new UseGiftCodeResult(code);}
		/// <summary>
        /// 
        /// </summary>
        public ChangeKanbanResult SC_changeKanbanResult(Task<ChangeKanbanResult> future){return new ChangeKanbanResult(future);}
        public ChangeKanbanResult SC_changeKanbanResult(int code){return new ChangeKanbanResult(code);}
		/// <summary>
        /// 
        /// </summary>
        public TriggerGuideResult SC_triggerGuideResult(Task<TriggerGuideResult> future){return new TriggerGuideResult(future);}
        public TriggerGuideResult SC_triggerGuideResult(int code, int id, int step, TriggerGuideType type){return new TriggerGuideResult(code, id, step, type);}
        public TriggerGuideResult SC_triggerGuideResult(int code){return new TriggerGuideResult(code);}
		/// <summary>
        /// 
        /// </summary>
        public RefreshReadPointResult SC_refreshReadPointResult(Task<RefreshReadPointResult> future){return new RefreshReadPointResult(future);}
        public RefreshReadPointResult SC_refreshReadPointResult(int code){return new RefreshReadPointResult(code);}
		/// <summary>
        /// 
        /// </summary>
        public SaveSettingDataResult SC_saveSettingDataResult(Task<SaveSettingDataResult> future){return new SaveSettingDataResult(future);}
        public SaveSettingDataResult SC_saveSettingDataResult(int code){return new SaveSettingDataResult(code);}
		/// <summary>
        /// 角色信息更新消息
        /// </summary>
		public bool SC_updatePlayerInfo(ISession session, UpdatePlayerInfoPOD update){
	        return NetProtocolHelper.SendMessage(session, new UpdatePlayerInfo(update));
	    }
	    public void SC_updatePlayerInfo_Broadcast(List<ISession> sessions, UpdatePlayerInfoPOD update){
	        NetProtocolHelper.BroadcastMessage(sessions, new UpdatePlayerInfo(update));
	    }
		/// <summary>
        /// 通知功能开启
        /// </summary>
		public bool SC_notifyFunctionTypeOpen(ISession session, int functionTypeId){
	        return NetProtocolHelper.SendMessage(session, new NotifyFunctionTypeOpen(functionTypeId));
	    }
	    public void SC_notifyFunctionTypeOpen_Broadcast(List<ISession> sessions, int functionTypeId){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyFunctionTypeOpen(functionTypeId));
	    }
		/// <summary>
        /// 通知事件解锁
        /// </summary>
		public bool SC_notifyUnlockEvent(ISession session, int eventCid){
	        return NetProtocolHelper.SendMessage(session, new NotifyUnlockEvent(eventCid));
	    }
	    public void SC_notifyUnlockEvent_Broadcast(List<ISession> sessions, int eventCid){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyUnlockEvent(eventCid));
	    }
		/// <summary>
        /// 通知罗盘能量恢复，recoveryEnergyTime=下次恢复时间戳
        /// </summary>
		public bool SC_notifyEnergyRecovery(ISession session, int energy, int nextRecoveryEnergyTime){
	        return NetProtocolHelper.SendMessage(session, new NotifyEnergyRecovery(energy, nextRecoveryEnergyTime));
	    }
	    public void SC_notifyEnergyRecovery_Broadcast(List<ISession> sessions, int energy, int nextRecoveryEnergyTime){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyEnergyRecovery(energy, nextRecoveryEnergyTime));
	    }
		/// <summary>
        /// 通知全局buff更新
        /// </summary>
		public bool SC_updatePlayerGlobalBuff(ISession session, List<GlobalBuffPOD> globalBuffs){
	        return NetProtocolHelper.SendMessage(session, new UpdatePlayerGlobalBuff(globalBuffs));
	    }
	    public void SC_updatePlayerGlobalBuff_Broadcast(List<ISession> sessions, List<GlobalBuffPOD> globalBuffs){
	        NetProtocolHelper.BroadcastMessage(sessions, new UpdatePlayerGlobalBuff(globalBuffs));
	    }
		/// <summary>
        ///  解锁头像
        /// </summary>
		public bool SC_notifyUnLockAvatar(ISession session, int avatarId, bool remove){
	        return NetProtocolHelper.SendMessage(session, new NotifyUnLockAvatar(avatarId, remove));
	    }
	    public void SC_notifyUnLockAvatar_Broadcast(List<ISession> sessions, int avatarId, bool remove){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyUnLockAvatar(avatarId, remove));
	    }
		/// <summary>
        ///  红点推送
        /// </summary>
		public bool SC_notifyReadPoint(ISession session, Dictionary<int, bool> readPoint){
	        return NetProtocolHelper.SendMessage(session, new NotifyReadPoint(readPoint));
	    }
	    public void SC_notifyReadPoint_Broadcast(List<ISession> sessions, Dictionary<int, bool> readPoint){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyReadPoint(readPoint));
	    }
		/// <summary>
        /// 更新玩家参数
        /// </summary>
		public bool SC_notifyUpdatePlayerParams(ISession session, int paramID, int value){
	        return NetProtocolHelper.SendMessage(session, new NotifyUpdatePlayerParams(paramID, value));
	    }
	    public void SC_notifyUpdatePlayerParams_Broadcast(List<ISession> sessions, int paramID, int value){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyUpdatePlayerParams(paramID, value));
	    }
		/// <summary>
        /// 通知效果提示
        /// </summary>
		public bool SC_notifyEffectNotice(ISession session, int effectType, List<int> effectParams, int num){
	        return NetProtocolHelper.SendMessage(session, new NotifyEffectNotice(effectType, effectParams, num));
	    }
	    public void SC_notifyEffectNotice_Broadcast(List<ISession> sessions, int effectType, List<int> effectParams, int num){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyEffectNotice(effectType, effectParams, num));
	    }
		/// <summary>
        /// 通知每日重置
        /// </summary>
		public bool SC_notifyDailyReset(ISession session, DailyResetPOD dailyReset){
	        return NetProtocolHelper.SendMessage(session, new NotifyDailyReset(dailyReset));
	    }
	    public void SC_notifyDailyReset_Broadcast(List<ISession> sessions, DailyResetPOD dailyReset){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyDailyReset(dailyReset));
	    }
		/// <summary>
        ///  解锁头像框
        /// </summary>
		public bool SC_notifyUnLockAvatarFrame(ISession session, int avatarFrame, bool remove){
	        return NetProtocolHelper.SendMessage(session, new NotifyUnLockAvatarFrame(avatarFrame, remove));
	    }
	    public void SC_notifyUnLockAvatarFrame_Broadcast(List<ISession> sessions, int avatarFrame, bool remove){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyUnLockAvatarFrame(avatarFrame, remove));
	    }
		/// <summary>
        ///  解锁称号
        /// </summary>
		public bool SC_notifyUnLockTitle(ISession session, int title, bool remove){
	        return NetProtocolHelper.SendMessage(session, new NotifyUnLockTitle(title, remove));
	    }
	    public void SC_notifyUnLockTitle_Broadcast(List<ISession> sessions, int title, bool remove){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyUnLockTitle(title, remove));
	    }
		/// <summary>
        /// 通知执行
        /// </summary>
		public bool SC_notifyExecution(ISession session, int id){
	        return NetProtocolHelper.SendMessage(session, new NotifyExecution(id));
	    }
	    public void SC_notifyExecution_Broadcast(List<ISession> sessions, int id){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyExecution(id));
	    }
		/// <summary>
        /// 通知头像时限更新
        /// </summary>
		public bool SC_notifyAvatarTimelimit(ISession session, Dictionary<int, int> avatarTimelimit){
	        return NetProtocolHelper.SendMessage(session, new NotifyAvatarTimelimit(avatarTimelimit));
	    }
	    public void SC_notifyAvatarTimelimit_Broadcast(List<ISession> sessions, Dictionary<int, int> avatarTimelimit){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyAvatarTimelimit(avatarTimelimit));
	    }
		/// <summary>
        /// 通知头像框时限更新
        /// </summary>
		public bool SC_notifyAvatarFrameTimelimit(ISession session, Dictionary<int, int> avatarFrameTimelimit){
	        return NetProtocolHelper.SendMessage(session, new NotifyAvatarFrameTimelimit(avatarFrameTimelimit));
	    }
	    public void SC_notifyAvatarFrameTimelimit_Broadcast(List<ISession> sessions, Dictionary<int, int> avatarFrameTimelimit){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyAvatarFrameTimelimit(avatarFrameTimelimit));
	    }
		/// <summary>
        /// 通知称号时限更新
        /// </summary>
		public bool SC_notifyTitleTimelimit(ISession session, Dictionary<int, int> titleTimelimit){
	        return NetProtocolHelper.SendMessage(session, new NotifyTitleTimelimit(titleTimelimit));
	    }
	    public void SC_notifyTitleTimelimit_Broadcast(List<ISession> sessions, Dictionary<int, int> titleTimelimit){
	        NetProtocolHelper.BroadcastMessage(sessions, new NotifyTitleTimelimit(titleTimelimit));
	    }
#endregion

#region Messages
	public class ChangeNameResult : MessageResult {
	    public ChangeNameResult(Task<ChangeNameResult> future): base(future) { }
		public ChangeNameResult(int code): base(code) { }
		public new ChangeNameResult SetDelayCall(Action delayCall) { base.SetDelayCall(delayCall); return this; }
        public override MessageResult GetFutureResult(Task task) { return ((Task<ChangeNameResult>)task).Result; }
		public override int GetMessageId() {return NetMessageId.player_changeNameResult;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_changeNameResult;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(code);
			return si_p;
		}
		public override string ToString() {
    		return "Player.SC_changeNameResult { "
			+ "code="
			+ code
			+" }";
		}
	}
	public class ChangeDataResult : MessageResult {
	    private ChangeDataType type;
	    public ChangeDataResult(Task<ChangeDataResult> future): base(future) { }
		public ChangeDataResult(int code): base(code) { }
		public new ChangeDataResult SetDelayCall(Action delayCall) { base.SetDelayCall(delayCall); return this; }
	    internal ChangeDataResult(int code, ChangeDataType type){
	        this.code = code;
	        this.type = type;
	    }
        public override MessageResult GetFutureResult(Task task) { return ((Task<ChangeDataResult>)task).Result; }
		public override int GetMessageId() {return NetMessageId.player_changeDataResult;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_changeDataResult;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(code);
			_out.Write_byte((sbyte)type);
			return si_p;
		}
		public override string ToString() {
    		return "Player.SC_changeDataResult { "
			+ "code="
			+ code
			+ ", type="
			+ type
			+" }";
		}
	}
	public class GetPlayerInfoResult : MessageResult {
	    private PlayerShowPOD playerShow;
	    public GetPlayerInfoResult(Task<GetPlayerInfoResult> future): base(future) { }
		public GetPlayerInfoResult(int code): base(code) { }
		public new GetPlayerInfoResult SetDelayCall(Action delayCall) { base.SetDelayCall(delayCall); return this; }
	    internal GetPlayerInfoResult(int code, PlayerShowPOD playerShow){
	        this.code = code;
	        this.playerShow = playerShow;
	    }
        public override MessageResult GetFutureResult(Task task) { return ((Task<GetPlayerInfoResult>)task).Result; }
		public override int GetMessageId() {return NetMessageId.player_getPlayerInfoResult;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_getPlayerInfoResult;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(code);
			_out.Write_pod(playerShow);
			return si_p;
		}
		public override string ToString() {
    		return "Player.SC_getPlayerInfoResult { "
			+ "code="
			+ code
			+ ", playerShow="
			+ playerShow
			+" }";
		}
	}
	public class UseGiftCodeResult : MessageResult {
	    private List<ItemShowPOD> items;
	    public UseGiftCodeResult(Task<UseGiftCodeResult> future): base(future) { }
		public UseGiftCodeResult(int code): base(code) { }
		public new UseGiftCodeResult SetDelayCall(Action delayCall) { base.SetDelayCall(delayCall); return this; }
	    internal UseGiftCodeResult(int code, List<ItemShowPOD> items){
	        this.code = code;
	        this.items = items == null ? null : new (items);
	    }
        public override MessageResult GetFutureResult(Task task) { return ((Task<UseGiftCodeResult>)task).Result; }
		public override int GetMessageId() {return NetMessageId.player_useGiftCodeResult;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_useGiftCodeResult;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(code);
			_out.Write_list_pod(items);
			return si_p;
		}
		public override string ToString() {
    		return "Player.SC_useGiftCodeResult { "
			+ "code="
			+ code
			+ ", items="
			+ items.ToString<ItemShowPOD>()
			+" }";
		}
	}
	public class ChangeKanbanResult : MessageResult {
	    public ChangeKanbanResult(Task<ChangeKanbanResult> future): base(future) { }
		public ChangeKanbanResult(int code): base(code) { }
		public new ChangeKanbanResult SetDelayCall(Action delayCall) { base.SetDelayCall(delayCall); return this; }
        public override MessageResult GetFutureResult(Task task) { return ((Task<ChangeKanbanResult>)task).Result; }
		public override int GetMessageId() {return NetMessageId.player_changeKanbanResult;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_changeKanbanResult;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(code);
			return si_p;
		}
		public override string ToString() {
    		return "Player.SC_changeKanbanResult { "
			+ "code="
			+ code
			+" }";
		}
	}
	public class TriggerGuideResult : MessageResult {
	    private int id;
	    private int step;
	    private TriggerGuideType type;
	    public TriggerGuideResult(Task<TriggerGuideResult> future): base(future) { }
		public TriggerGuideResult(int code): base(code) { }
		public new TriggerGuideResult SetDelayCall(Action delayCall) { base.SetDelayCall(delayCall); return this; }
	    internal TriggerGuideResult(int code, int id, int step, TriggerGuideType type){
	        this.code = code;
	        this.id = id;
	        this.step = step;
	        this.type = type;
	    }
        public override MessageResult GetFutureResult(Task task) { return ((Task<TriggerGuideResult>)task).Result; }
		public override int GetMessageId() {return NetMessageId.player_triggerGuideResult;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_triggerGuideResult;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(code);
			_out.Write_int(id);
			_out.Write_int(step);
			_out.Write_byte((sbyte)type);
			return si_p;
		}
		public override string ToString() {
    		return "Player.SC_triggerGuideResult { "
			+ "code="
			+ code
			+ ", id="
			+ id
			+ ", step="
			+ step
			+ ", type="
			+ type
			+" }";
		}
	}
	public class RefreshReadPointResult : MessageResult {
	    public RefreshReadPointResult(Task<RefreshReadPointResult> future): base(future) { }
		public RefreshReadPointResult(int code): base(code) { }
		public new RefreshReadPointResult SetDelayCall(Action delayCall) { base.SetDelayCall(delayCall); return this; }
        public override MessageResult GetFutureResult(Task task) { return ((Task<RefreshReadPointResult>)task).Result; }
		public override int GetMessageId() {return NetMessageId.player_refreshReadPointResult;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_refreshReadPointResult;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(code);
			return si_p;
		}
		public override string ToString() {
    		return "Player.SC_refreshReadPointResult { "
			+ "code="
			+ code
			+" }";
		}
	}
	public class SaveSettingDataResult : MessageResult {
	    public SaveSettingDataResult(Task<SaveSettingDataResult> future): base(future) { }
		public SaveSettingDataResult(int code): base(code) { }
		public new SaveSettingDataResult SetDelayCall(Action delayCall) { base.SetDelayCall(delayCall); return this; }
        public override MessageResult GetFutureResult(Task task) { return ((Task<SaveSettingDataResult>)task).Result; }
		public override int GetMessageId() {return NetMessageId.player_saveSettingDataResult;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_saveSettingDataResult;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(code);
			return si_p;
		}
		public override string ToString() {
    		return "Player.SC_saveSettingDataResult { "
			+ "code="
			+ code
			+" }";
		}
	}
	public class UpdatePlayerInfo : MessageNotify {
		private UpdatePlayerInfoPOD update;
		public UpdatePlayerInfo(UpdatePlayerInfoPOD update) {
		    this.update = update;
		}
		public override int GetMessageId() {return NetMessageId.player_updatePlayerInfo;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_updatePlayerInfo;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_pod(update);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_updatePlayerInfo { "
			+ "update="
			+ update
			+" }";
		}
	}
	public class NotifyFunctionTypeOpen : MessageNotify {
		private int functionTypeId;
		public NotifyFunctionTypeOpen(int functionTypeId) {
		    this.functionTypeId = functionTypeId;
		}
		public override int GetMessageId() {return NetMessageId.player_notifyFunctionTypeOpen;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyFunctionTypeOpen;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(functionTypeId);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyFunctionTypeOpen { "
			+ "functionTypeId="
			+ functionTypeId
			+" }";
		}
	}
	public class NotifyUnlockEvent : MessageNotify {
		private int eventCid;
		public NotifyUnlockEvent(int eventCid) {
		    this.eventCid = eventCid;
		}
		public override int GetMessageId() {return NetMessageId.player_notifyUnlockEvent;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyUnlockEvent;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(eventCid);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyUnlockEvent { "
			+ "eventCid="
			+ eventCid
			+" }";
		}
	}
	public class NotifyEnergyRecovery : MessageNotify {
		private int energy;
		private int nextRecoveryEnergyTime;
		public NotifyEnergyRecovery(int energy, int nextRecoveryEnergyTime) {
		    this.energy = energy;
		    this.nextRecoveryEnergyTime = nextRecoveryEnergyTime;
		}
		public override int GetMessageId() {return NetMessageId.player_notifyEnergyRecovery;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyEnergyRecovery;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(energy);
			_out.Write_int(nextRecoveryEnergyTime);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyEnergyRecovery { "
			+ "energy="
			+ energy
			+ ", nextRecoveryEnergyTime="
			+ nextRecoveryEnergyTime
			+" }";
		}
	}
	public class UpdatePlayerGlobalBuff : MessageNotify {
		private List<GlobalBuffPOD> globalBuffs;
		public UpdatePlayerGlobalBuff(List<GlobalBuffPOD> globalBuffs) {
		    this.globalBuffs = globalBuffs == null ? null : new (globalBuffs);
		}
		public override int GetMessageId() {return NetMessageId.player_updatePlayerGlobalBuff;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_updatePlayerGlobalBuff;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_list_pod(globalBuffs);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_updatePlayerGlobalBuff { "
			+ "globalBuffs="
			+ globalBuffs.ToString<GlobalBuffPOD>()
			+" }";
		}
	}
	public class NotifyUnLockAvatar : MessageNotify {
		private int avatarId;
		private bool remove;
		public NotifyUnLockAvatar(int avatarId, bool remove) {
		    this.avatarId = avatarId;
		    this.remove = remove;
		}
		public override int GetMessageId() {return NetMessageId.player_notifyUnLockAvatar;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyUnLockAvatar;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(avatarId);
			_out.Write_boolean(remove);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyUnLockAvatar { "
			+ "avatarId="
			+ avatarId
			+ ", remove="
			+ remove
			+" }";
		}
	}
	public class NotifyReadPoint : MessageNotify {
		private Dictionary<int, bool> readPoint;
		public NotifyReadPoint(Dictionary<int, bool> readPoint) {
		    this.readPoint = readPoint == null ? null : new (readPoint);
		}
		public override int GetMessageId() {return NetMessageId.player_notifyReadPoint;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyReadPoint;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_map_int_boolean(readPoint);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyReadPoint { "
			+ "readPoint="
			+ readPoint.ToString<int, bool>()
			+" }";
		}
	}
	public class NotifyUpdatePlayerParams : MessageNotify {
		private int paramID;
		private int value;
		public NotifyUpdatePlayerParams(int paramID, int value) {
		    this.paramID = paramID;
		    this.value = value;
		}
		public override int GetMessageId() {return NetMessageId.player_notifyUpdatePlayerParams;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyUpdatePlayerParams;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(paramID);
			_out.Write_int(value);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyUpdatePlayerParams { "
			+ "paramID="
			+ paramID
			+ ", value="
			+ value
			+" }";
		}
	}
	public class NotifyEffectNotice : MessageNotify {
		private int effectType;
		private List<int> effectParams;
		private int num;
		public NotifyEffectNotice(int effectType, List<int> effectParams, int num) {
		    this.effectType = effectType;
		    this.effectParams = effectParams == null ? null : new (effectParams);
		    this.num = num;
		}
		public override int GetMessageId() {return NetMessageId.player_notifyEffectNotice;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyEffectNotice;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(effectType);
			_out.Write_list_int(effectParams);	
			_out.Write_int(num);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyEffectNotice { "
			+ "effectType="
			+ effectType
			+ ", effectParams="
			+ effectParams.ToString<int>()
			+ ", num="
			+ num
			+" }";
		}
	}
	public class NotifyDailyReset : MessageNotify {
		private DailyResetPOD dailyReset;
		public NotifyDailyReset(DailyResetPOD dailyReset) {
		    this.dailyReset = dailyReset;
		}
		public override int GetMessageId() {return NetMessageId.player_notifyDailyReset;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyDailyReset;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_pod(dailyReset);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyDailyReset { "
			+ "dailyReset="
			+ dailyReset
			+" }";
		}
	}
	public class NotifyUnLockAvatarFrame : MessageNotify {
		private int avatarFrame;
		private bool remove;
		public NotifyUnLockAvatarFrame(int avatarFrame, bool remove) {
		    this.avatarFrame = avatarFrame;
		    this.remove = remove;
		}
		public override int GetMessageId() {return NetMessageId.player_notifyUnLockAvatarFrame;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyUnLockAvatarFrame;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(avatarFrame);
			_out.Write_boolean(remove);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyUnLockAvatarFrame { "
			+ "avatarFrame="
			+ avatarFrame
			+ ", remove="
			+ remove
			+" }";
		}
	}
	public class NotifyUnLockTitle : MessageNotify {
		private int title;
		private bool remove;
		public NotifyUnLockTitle(int title, bool remove) {
		    this.title = title;
		    this.remove = remove;
		}
		public override int GetMessageId() {return NetMessageId.player_notifyUnLockTitle;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyUnLockTitle;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(title);
			_out.Write_boolean(remove);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyUnLockTitle { "
			+ "title="
			+ title
			+ ", remove="
			+ remove
			+" }";
		}
	}
	public class NotifyExecution : MessageNotify {
		private int id;
		public NotifyExecution(int id) {
		    this.id = id;
		}
		public override int GetMessageId() {return NetMessageId.player_notifyExecution;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyExecution;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_int(id);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyExecution { "
			+ "id="
			+ id
			+" }";
		}
	}
	public class NotifyAvatarTimelimit : MessageNotify {
		private Dictionary<int, int> avatarTimelimit;
		public NotifyAvatarTimelimit(Dictionary<int, int> avatarTimelimit) {
		    this.avatarTimelimit = avatarTimelimit == null ? null : new (avatarTimelimit);
		}
		public override int GetMessageId() {return NetMessageId.player_notifyAvatarTimelimit;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyAvatarTimelimit;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_map_int_int(avatarTimelimit);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyAvatarTimelimit { "
			+ "avatarTimelimit="
			+ avatarTimelimit.ToString<int, int>()
			+" }";
		}
	}
	public class NotifyAvatarFrameTimelimit : MessageNotify {
		private Dictionary<int, int> avatarFrameTimelimit;
		public NotifyAvatarFrameTimelimit(Dictionary<int, int> avatarFrameTimelimit) {
		    this.avatarFrameTimelimit = avatarFrameTimelimit == null ? null : new (avatarFrameTimelimit);
		}
		public override int GetMessageId() {return NetMessageId.player_notifyAvatarFrameTimelimit;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyAvatarFrameTimelimit;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_map_int_int(avatarFrameTimelimit);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyAvatarFrameTimelimit { "
			+ "avatarFrameTimelimit="
			+ avatarFrameTimelimit.ToString<int, int>()
			+" }";
		}
	}
	public class NotifyTitleTimelimit : MessageNotify {
		private Dictionary<int, int> titleTimelimit;
		public NotifyTitleTimelimit(Dictionary<int, int> titleTimelimit) {
		    this.titleTimelimit = titleTimelimit == null ? null : new (titleTimelimit);
		}
		public override int GetMessageId() {return NetMessageId.player_notifyTitleTimelimit;}
		public override SendPackage ToPackage() {
			SendPackage si_p = NetProtocolHelper.GetSendPackage();
			si_p.Header.Messagid = NetMessageId.player_notifyTitleTimelimit;
			si_p.StartWrite();
			SOutputStream _out = si_p.OutputStream;
			_out.Write_map_int_int(titleTimelimit);
			return si_p;
		}
		public override string ToString() {
			return "Player.SC_notifyTitleTimelimit { "
			+ "titleTimelimit="
			+ titleTimelimit.ToString<int, int>()
			+" }";
		}
	}
	private class ChangeNameRequest : IReceiveMessage
    {
		internal string newName;
        public void FromPackage(ReceivePackage package)
		{
			SInputStream _in = package.InputStream;
            newName = _in.HasRemaining() ? _in.Read_string() : default;
		}
        public int GetMessageId() { return NetMessageId.player_changeName; }
        public override string ToString()
        {
            return "Player.changeName"+ ", newName="+ newName;
        }
    }
	private class ChangeDataRequest : IReceiveMessage
    {
		internal ChangeDataType type;
		internal string content;
        public void FromPackage(ReceivePackage package)
		{
			SInputStream _in = package.InputStream;
            type = _in.HasRemaining() ? (ChangeDataType)_in.Read_byte() : default;
            content = _in.HasRemaining() ? _in.Read_string() : default;
		}
        public int GetMessageId() { return NetMessageId.player_changeData; }
        public override string ToString()
        {
            return "Player.changeData"+ ", type="+ type+ ", content="+ content;
        }
    }
	private class GetPlayerInfoRequest : IReceiveMessage
    {
		internal string targetServerId;
		internal long targetPid;
        public void FromPackage(ReceivePackage package)
		{
			SInputStream _in = package.InputStream;
            targetServerId = _in.HasRemaining() ? _in.Read_string() : default;
            targetPid = _in.HasRemaining() ? _in.Read_long() : default;
		}
        public int GetMessageId() { return NetMessageId.player_getPlayerInfo; }
        public override string ToString()
        {
            return "Player.getPlayerInfo"+ ", targetServerId="+ targetServerId+ ", targetPid="+ targetPid;
        }
    }
	private class UseGiftCodeRequest : IReceiveMessage
    {
		internal string code;
        public void FromPackage(ReceivePackage package)
		{
			SInputStream _in = package.InputStream;
            code = _in.HasRemaining() ? _in.Read_string() : default;
		}
        public int GetMessageId() { return NetMessageId.player_useGiftCode; }
        public override string ToString()
        {
            return "Player.useGiftCode"+ ", code="+ code;
        }
    }
	private class ChangeKanbanRequest : IReceiveMessage
    {
		internal int cid;
        public void FromPackage(ReceivePackage package)
		{
			SInputStream _in = package.InputStream;
            cid = _in.HasRemaining() ? _in.Read_int() : default;
		}
        public int GetMessageId() { return NetMessageId.player_changeKanban; }
        public override string ToString()
        {
            return "Player.changeKanban"+ ", cid="+ cid;
        }
    }
	private class TriggerGuideRequest : IReceiveMessage
    {
		internal int id;
		internal int step;
		internal TriggerGuideType type;
        public void FromPackage(ReceivePackage package)
		{
			SInputStream _in = package.InputStream;
            id = _in.HasRemaining() ? _in.Read_int() : default;
            step = _in.HasRemaining() ? _in.Read_int() : default;
            type = _in.HasRemaining() ? (TriggerGuideType)_in.Read_byte() : default;
		}
        public int GetMessageId() { return NetMessageId.player_triggerGuide; }
        public override string ToString()
        {
            return "Player.triggerGuide"+ ", id="+ id+ ", step="+ step+ ", type="+ type;
        }
    }
	private class RefreshReadPointRequest : IReceiveMessage
    {
		internal int type;
        public void FromPackage(ReceivePackage package)
		{
			SInputStream _in = package.InputStream;
            type = _in.HasRemaining() ? _in.Read_int() : default;
		}
        public int GetMessageId() { return NetMessageId.player_refreshReadPoint; }
        public override string ToString()
        {
            return "Player.refreshReadPoint"+ ", type="+ type;
        }
    }
	private class SaveSettingDataRequest : IReceiveMessage
    {
		internal string key;
		internal string value;
        public void FromPackage(ReceivePackage package)
		{
			SInputStream _in = package.InputStream;
            key = _in.HasRemaining() ? _in.Read_string() : default;
            value = _in.HasRemaining() ? _in.Read_string() : default;
		}
        public int GetMessageId() { return NetMessageId.player_saveSettingData; }
        public override string ToString()
        {
            return "Player.saveSettingData"+ ", key="+ key+ ", value="+ value;
        }
    }
	private class UploadStoryCompletedRequest : IReceiveMessage
    {
		internal GamePlayAreaType areaType;
		internal int storyCid;
        public void FromPackage(ReceivePackage package)
		{
			SInputStream _in = package.InputStream;
            areaType = _in.HasRemaining() ? (GamePlayAreaType)_in.Read_byte() : default;
            storyCid = _in.HasRemaining() ? _in.Read_int() : default;
		}
        public int GetMessageId() { return NetMessageId.player_uploadStoryCompleted; }
        public override string ToString()
        {
            return "Player.uploadStoryCompleted"+ ", areaType="+ areaType+ ", storyCid="+ storyCid;
        }
    }
	}
#endregion
}